package entity;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.NotEmpty;

public class Users {
	
	@NotEmpty(message="用户名不能为空")
	@NotNull(message="用户名不能为空")
	private String name;
	@Max(value=100,message="年龄不能超过100")
	@Min(value=1,message="年龄不能小于1")
	private int  age;
	 @Pattern(regexp="[男女]",message="性别只能是男或者女")
	private String sex;
	 
	private int deptno;  //外键
	 
	
	public Users() {
	}
	public Users(String name, String sex, int age,int deptno) {
		super();
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.deptno=deptno;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public int getDeptno() {
		return deptno;
	}
	public void setDeptno(int deptno) {
		this.deptno = deptno;
	}
	
	
}
